package cn.zxf.note.user.platform;

import cn.zxf.note.common.jpa.AbstractEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint;

/**
 * Created by zengxf on 2020/3/25.
 */
@Entity
@Table(
        name = "user_platform",
        uniqueConstraints = {@UniqueConstraint(name = "uni_platform_open_id", columnNames = {"platform", "openId"})}
)
@DynamicInsert
@DynamicUpdate
@Data
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class UserPlatform extends AbstractEntity {

    /*** 平台 {@link PlatformEnum} */
    private String platform;
    private String openId;
    private Integer userId;

}
